package dao;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.Properties;

public class DaoUserHasCombinaisons extends Dao {
	Properties sql = new Properties();
	public DaoUserHasCombinaisons() {			
		try {
			FileInputStream in = new FileInputStream(config.getProperty("sqlUsersHasCombinaisons"));
			sql.load(in);
			in.close();
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	public int create(int idUser,int idCombinaison){
			PreparedStatement pst;
			try {
				pst = con.prepareStatement(sql.getProperty("create"));
				pst.setInt(1, idUser);
				pst.setInt(2,idCombinaison);
		
				return pst.executeUpdate();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				return 0;
			}
			
			
	}

	
}
